
package com.amigo.online.provider.merchant.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import com.amigo.online.common.core.mybatis.MyMapper;
import com.amigo.online.provider.merchant.model.entity.MerchantConcern;


@Mapper
@Component
public interface MerchantConcernMapper extends MyMapper<MerchantConcern> {

    @Update("update merchant_concern_tbl set deleted = 1,deleted_time = #{nowTime} where user_id = #{userId} and merchant_id = #{merId}")
    Integer updateDeleted(@Param("userId") Long userId, @Param("merId") Long merId, @Param("nowTime") Long nowTime);

    @Select("select count(*) from merchant_concern_tbl where merchant_id = #{merId} and deleted = 0")
    Integer getConcernCount(@Param("merId") Long merId);


}